package com.jy.rhin.parse;


import com.jy.rhin.infra.cda.XPath;
import lombok.extern.slf4j.Slf4j;
import org.seimicrawler.xpath.JXNode;
import org.springframework.stereotype.Component;

import java.util.Objects;
/**
 * @author shenguangayng
 */
@Component
@Slf4j
public class ItemElementTextSelector implements Selector {

    @Override
    public String selectValue(JXNode root, XPath xPath) {
        if (Objects.nonNull(root)) {
            return root.asElement().text();
        }
        return null;
    }

}
